<template name="myluck">
	<view class="" style="min-height: 100vh;overflow: hidden;"
		:style="{background:'url('+Imgbase+'/'+skin+'_goodindex_bgc.png)','background-size':'100%',}">


		<!-- tab选项 -->
		<view class="w100 df jc-sb padding-left-40 padding-right-40 padding-top-150">
			<view class="df">
				<!-- <image class="w-80 h-80" :src=" Imgbase+'/new_goodbp_img7.png'" mode="aspectFit">
				</image> -->

				<!-- 保险箱 -->
				<image @click="tabsuo(1)" v-if="lockIndex == 0" class="w-100 h-80"
					:src=" Imgbase+'/new_goodbp_img2.png'" mode="aspectFit">
				</image>

				<!-- 赏袋 -->
				<image @click="tabsuo(0)" v-if="lockIndex == 1" class="w-100 h-80"
					:src=" Imgbase+'/new_goodbp_img9.png'" mode="aspectFit">
				</image>

				<view class="baoxiang df" v-if="boxcount > 0">
					<view class="animation">
						<image @click="gocag()" class="w-100 h-80" :src=" Imgbase+'/1zhan_new_baoxiang.png'"
							mode="aspectFit">
						</image>
					</view>
					<view class="baotext padding-left-20 font-22 font-weight-500">
						快开我
					</view>
				</view>
			</view>
			<view class="df">
				<image @click="explain(6)" class="w-100 h-80 margin-left-15" :src=" Imgbase+'/new_goodbp_img1.png'"
					mode="aspectFit">
				</image>
			</view>
		</view>

		<view class="flex-between padding-left-40 padding-right-40 padding-top-15">
			<view class="">
				<image @click="goadvanced()" class="w-300 h-120" :src=" Imgbase+'/new_goodbp_img3.png'"
					mode="aspectFit">
				</image>
			</view>
			<view class="">
				<image @click="pushdeliver()" class="w-300 h-120" :src=" Imgbase+'/new_goodbp_img4.png'"
					mode="aspectFit">
				</image>
			</view>
		</view>

		<!-- 列表 -->
		<view class="w100 margin-top-10 padding-left-20 padding-right-20 padding-bottom-200" style="overflow: hidden;">
			
			<view class="list_item h-365 Afont font-24 itemqing" v-for="(item,index) in userlist" :key="index"
				v-if="skin == 'qing'">
				<view class="w100 h-230 radius-15"
					style="border: 4rpx solid #5C5C92;overflow: hidden;position: relative;">
					<view class="w-30 h-30 pos_dot flex-center" @click="chooseGoods(index)">
						<view class="dotd w-18 h-18" v-if="item.checked == 1">
			
						</view>
					</view>
			
					<view style="position: absolute;right: 10rpx;top: 10rpx;z-index: 99;" @click="chooseGoods(index)">
						<image :src="Imgbase + '/1zhan_goodstate' +item.state+ '.png'" mode="aspectFit"
							class="w-50 h-40"></image>
					</view>
			
					<!-- 转换红豆按钮 -->
					<!-- <view class="hongbtn w-80 h-30" v-if="item.reword_type_id == 22">
						<u-button type="error" text="换红豆" size="mini" @click="hongon(index)"></u-button>
					</view> -->
			
					<image class="w100 h100 " :src="item.adimage" mode="aspectFill" v-if="dui== 1"
						@click="lookImages(item.adimage,item.name)"></image>
			
					<image class="w100 h100 " :src="item.goodmes.adimage" mode="aspectFill" v-else
						@click="lookImages(item.goodmes.adimage,item.goodmes.name)"></image>
				</view>
			
				<view class="h-58 two-line w100 padding-left-10 padding-right-10" @click="chooseGoods(index)">
					<text v-if="dui== 1">{{item.name}}</text>
					<text v-else>{{item.goodmes.name}}</text>
				</view>
			
				<view class="h-25 padding-left-10 ">
					<text v-if="dui== 1">数量: {{item.num}}</text>
				</view>
			
				<view class="flex-between padding-left-10 padding-right-10 padding-top-2">
					<view class="">
						{{item.reword_type_name}}赏
					</view>
					<view class="padding-top-5 ">
						<image class="w-30 h-30" v-if="lockIndex == 0" @click="lockbtn(index)"
							:src=" Imgbase+'/new_goodbp_img6.png'" mode="aspectFit"></image>
						<image class="w-30 h-30" v-if="lockIndex == 1" @click="unlockbtn(index)"
							:src=" Imgbase+'/new_goodbp_img5.png'" mode="aspectFit"></image>
					</view>
				</view>
			
			</view>
			
			<view class="list_item h-365 Afont font-24" v-for="(item,index) in userlist" :key="index" v-if="skin !== 'qing'"
				:style="{background:'url('+Imgbase+'/'+skin+'_goodindex_img6.png)','background-size':'100% 100%',}">
				<view class="w100 h-230 radius-15"
					style="border: 4rpx solid #5C5C92;overflow: hidden;position: relative;">
					<view class="w-30 h-30 pos_dot flex-center" @click="chooseGoods(index)">
						<view class="dotd w-18 h-18" v-if="item.checked == 1">
			
						</view>
					</view>
			
					<view style="position: absolute;right: 10rpx;top: 10rpx;z-index: 99;" @click="chooseGoods(index)">
						<image :src="Imgbase + '/1zhan_goodstate' +item.state+ '.png'" mode="aspectFit"
							class="w-50 h-40"></image>
					</view>
			
					<!-- 转换红豆按钮 -->
					<!-- <view class="hongbtn w-80 h-30" v-if="item.reword_type_id == 22">
						<u-button type="error" text="换红豆" size="mini" @click="hongon(index)"></u-button>
					</view> -->
			
					<image class="w100 h100 " :src="item.adimage" mode="aspectFill" v-if="dui== 1"
						@click="lookImages(item.adimage,item.name)"></image>
			
					<image class="w100 h100 " :src="item.goodmes.adimage" mode="aspectFill" v-else
						@click="lookImages(item.goodmes.adimage,item.goodmes.name)"></image>
				</view>
			
				<view class="h-58 two-line w100 padding-left-10 padding-right-10" @click="chooseGoods(index)">
					<text v-if="dui== 1">{{item.name}}</text>
					<text v-else>{{item.goodmes.name}}</text>
				</view>
			
				<view class="h-25 padding-left-10 ">
					<text v-if="dui== 1">数量: {{item.num}}</text>
				</view>
			
				<view class="flex-between padding-left-10 padding-right-10 padding-top-2">
					<view class="">
						{{item.reword_type_name}}赏
					</view>
					<view class="padding-top-5 ">
						<image class="w-30 h-30" v-if="lockIndex == 0" @click="lockbtn(index)"
							:src=" Imgbase+'/new_goodbp_img6.png'" mode="aspectFit"></image>
						<image class="w-30 h-30" v-if="lockIndex == 1" @click="unlockbtn(index)"
							:src=" Imgbase+'/new_goodbp_img5.png'" mode="aspectFit"></image>
					</view>
				</view>
			
			</view>

			<view class="h-200">

			</view>
		</view>


		<!-- 经典皮肤 -->
		<view class="w100 h-160 tabbars " v-if="skin == 'classics'">
			<view class="flex-between h-140" style="position: relative;z-index: 9999;">
				<view class="" @click="seletab(1)">
					<view class="w-120 h-120 text-center">
						<image :src=" Imgbase+'/new_good_tab1.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(2)">
					<view class="w-120 h-120 text-center">
						<image :src=" Imgbase+'/new_good_tab2.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(3)">
					<view class="w-120 h-140 text-center padding-bottom-10">
						<image :src=" Imgbase+'/new_good_tab3.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(4)">
					<view class="w-120 h-120 text-center">
						<image :src=" Imgbase+'/new_good_tab4.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="padding-bottom-10" @click="seletab(5)">
					<view class="w-120 h-120 text-center">
						<image :src=" Imgbase+'/new_good_tab5.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
			</view>
			<view class="bgcs">

			</view>
			<view class="bgcs_top">

			</view>
		</view>

		<!-- 冬季皮肤 -->
		<view class="w100 h-160 tabbars " v-if="skin == 'winter'">
			<view class="flex-between h-140" style="position: relative;z-index: 9999;">
				<view class="padding-bottom-50" @click="seletab(1)">
					<view class="w-130 h-150 text-center ">
						<image :src=" Imgbase+'/winter_goodtab1.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="padding-bottom-15" @click="seletab(2)">
					<view class="w-120 h-120 text-center">
						<image :src=" Imgbase+'/winter_goodtab2.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="padding-bottom-20" @click="seletab(3)">
					<view class="w-125 h-125 text-center">
						<image :src=" Imgbase+'/winter_goodtab3.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(4)">
					<view class="w-115 h-115 text-center">
						<image :src=" Imgbase+'/winter_goodtab4.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="padding-bottom-15" @click="seletab(5)">
					<view class="w-120 h-120 text-center">
						<image :src=" Imgbase+'/winter_goodtab5.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
			</view>
			<view class="bgcswinter">

			</view>
			<view class="bgcs_topwinter">

			</view>
		</view>

		<!-- 新年皮肤 -->
		<view class="w100 h-160 tabbars " v-if="skin == 'newyear'">
			<view class="flex-between h-120" style="position: relative;z-index: 9999;">
				<view class="" @click="seletab(1)">
					<view class="w-120 h-120 text-center">
						<image :src=" Imgbase+'/newyear_goodtab1.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(2)">
					<view class="w-120 h-120 text-center">
						<image :src=" Imgbase+'/newyear_goodtab2.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(3)">
					<view class="w-120 h-120 text-center ">
						<image :src=" Imgbase+'/newyear_goodtab3.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(4)">
					<view class="w-120 h-120 text-center">
						<image :src=" Imgbase+'/newyear_goodtab4.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="padding-bottom-10" @click="seletab(5)">
					<view class="w-120 h-120 text-center">
						<image :src=" Imgbase+'/newyear_goodtab5.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
			</view>
			<view class="bgcsnewyear w100 h-200"
				:style="{background:'url('+Imgbase+'/newyear_goodbgc.png)','background-size':'100% 100%',}">

			</view>
		</view>
		
		<!-- 春季皮肤 -->
		<view class=" padding-bottom-25 w100 h-160 tabbars " v-if="skin == 'qing'">
			<view class="flex-between h-120" style="position: relative;z-index: 9999;">
				<view class="" @click="seletab(1)">
					<view class="w-130 h-130 text-center">
						<image :src=" Imgbase+'/qing_goodtab1.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(2)">
					<view class="w-130 h-130 text-center">
						<image :src=" Imgbase+'/qing_goodtab2.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(3)">
					<view class="w-130 h-130 text-center ">
						<image :src=" Imgbase+'/qing_goodtab3.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(4)">
					<view class="w-130 h-130 text-center">
						<image :src=" Imgbase+'/qing_goodtab4.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="padding-top-10" @click="seletab(5)">
					<view class="w-130 h-130 text-center">
						<image :src=" Imgbase+'/qing_goodtab5.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
			</view>
			<view class="bgcsqing w100 h-110"
				:style="{background:'url('+Imgbase+'/qing_goodbgc.png)','background-size':'100% 100%',}">
		
			</view>
		</view>
		
		<!-- 夏季皮肤 -->
		<view class=" padding-bottom-25 w100 h-160 tabbars " v-if="skin == 'summer'">
			<view class="flex-between h-120" style="position: relative;z-index: 9999;">
				<view class="" @click="seletab(1)">
					<view class="w-130 h-130 text-center">
						<image :src=" Imgbase+'/summer_goodtab1.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(2)">
					<view class="w-140 h-130 text-center">
						<image :src=" Imgbase+'/summer_goodtab2.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(3)">
					<view class="w-130 h-130 text-center ">
						<image :src=" Imgbase+'/summer_goodtab3.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="" @click="seletab(4)">
					<view class="w-140 h-140 text-center">
						<image :src=" Imgbase+'/summer_goodtab4.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
				<view class="padding-top-10" @click="seletab(5)">
					<view class="w-130 h-130 text-center">
						<image :src=" Imgbase+'/summer_goodtab5.png'" mode="aspectFit" class="w100 h100 margin-top-10">
						</image>
					</view>
				</view>
			</view>
			<view class="bgcsqing w100 h-110"
				:style="{background:'url('+Imgbase+'/summer_goodbgc.png)','background-size':'100% 100%',}">
		
			</view>
		</view>

		<!-- 筛选 -->
		<view class="cu-modal drawer-modal justify-end" :class="modalName=='showOrder'?'show':''" @tap="hideModal">
			<view class="cu-dialog basis-lg" @tap.stop="" style="background-color: #fafaec;flex-basis: 81%;">
				<view style="width: 100%;height: 130upx;"></view>
				<view class="flex fl text-xl text-bold" style="padding-top: 14upx;padding-left: 40upx;color: #635120;">
					类型
				</view>
				<view class="flex fr" style="padding-top: 22upx;padding-right: 50upx;">
					<view style="width: 160upx;margin-right: 20upx;">
						<image :src="Imgbase + '/backpack_select_1_1.png'" style="width: 160upx;height: 100upx;"
							v-if="goodstateIndexchoose != -1" @click="backpack_select_1_1(-1)"></image>
						<image :src="Imgbase + '/backpack_select_1_1b.png'" style="width: 160upx;height: 100upx;"
							v-if="goodstateIndexchoose == -1"></image>
					</view>
					<view style="width: 160upx;margin-right: 20upx;">
						<image :src="Imgbase + '/backpack_select_1_2.png'" style="width: 160upx;height: 100upx;"
							v-if="goodstateIndexchoose != 0" @click="chooseGoodstate(0)"></image>
						<image :src="Imgbase + '/backpack_select_1_2b.png'" style="width: 160upx;height: 100upx;"
							v-if="goodstateIndexchoose == 0"></image>
					</view>
					<view style="width: 160upx;">
						<image :src="Imgbase + '/backpack_select_1_3.png'" style="width: 160upx;height: 100upx;"
							v-if="goodstateIndexchoose != 1" @click="chooseGoodstate(1)"></image>
						<image :src="Imgbase + '/backpack_select_1_3b.png'" style="width: 160upx;height: 100upx;"
							v-if="goodstateIndexchoose == 1"></image>
					</view>
				</view>
				<view class="flex fr" style="padding-top: 14upx;;padding-right: 50upx;">
					<view style="width: 160upx;margin-right: 20upx;">
						<image :src="Imgbase + '/backpack_select_2_1.png'" style="width: 160upx;height: 100upx;"
							v-if="orderwayIndexchoose != 'createtime'" @click="chooseOrderway('createtime')">
						</image>
						<image :src="Imgbase + '/backpack_select_2_1b.png'" style="width: 160upx;height: 100upx;"
							v-if="orderwayIndexchoose == 'createtime'"></image>
					</view>
					<view style="width: 160upx;margin-right: 20upx;">
						<image :src="Imgbase + '/backpack_select_2_2.png'" style="width: 160upx;height: 100upx;"
							v-if="orderwayIndexchoose != 'reword_type_id'" @click="chooseOrderway('reword_type_id')">
						</image>
						<image :src="Imgbase + '/backpack_select_2_2b.png'" style="width: 160upx;height: 100upx;"
							v-if="orderwayIndexchoose == 'reword_type_id'"></image>
					</view>
					<view style="width: 160upx;">
						<image :src="Imgbase + '/backpack_select_2_3.png'" style="width: 160upx;height: 100upx;"
							v-if="orderwayIndexchoose != 'back_price'" @click="chooseOrderway('back_price')">
						</image>
						<image :src="Imgbase + '/backpack_select_2_3b.png'" style="width: 160upx;height: 100upx;"
							v-if="orderwayIndexchoose == 'back_price'"></image>
					</view>
				</view>
				<view style="clear: both;"></view>
				<view class="flex fl" style="padding-left: 40upx;position: absolute; bottom: 15%;">
					<view style="width: 240upx;margin-right: 30upx;">
						<image :src="Imgbase + '/backpack_select_b1.png'" mode="widthFix" @click="resetChoose()">
						</image>
					</view>
					<view style="width: 240upx;margin-right: 10upx;">
						<image :src="Imgbase + '/backpack_select_b2.png'" mode="widthFix" @click="sureChoose()">
						</image>
					</view>
				</view>
			</view>
		</view>

		<view class="cu-modal" :class="modalName=='photomodel'?'show':''" @tap="hideModal">
			<view class="cu-dialog" style="width: 90%;height: 800rpx;background-color: #fff;" @tap.stop="">
				<view class="" style="width: 100%;position: relative;">
					<image :src="photoimg" mode="widthFix" style="width: 100%;height: 100%;"></image>
					<view class="" @click="modalName = null"
						style="position: absolute;width: 50rpx;height: 50rpx;top: 20rpx;right: 25rpx;z-index: 999;">
						<image :src="Imgbase + '/new1_infinite_close.png'" mode="widthFix"
							style="width: 100%;height: 100%;"></image>
					</view>
				</view>

				<view class="Afont" style="margin-top: 40rpx;text-align: center;font-weight: bold;">
					{{looktitle}}
				</view>
			</view>
		</view>

		<!-- 堆叠  展开 -->
		<view class="fixed_item" :class="fixed==0?'fixeds':'fixed_three'">
			<!-- <image @click="" class="w-90 h-90" :src=" Imgbase+'/kp_backp_fix4.png'" mode="aspectFit">
		</image> -->
			<image @click="godui(1)" class="w-105 h-105" :src=" Imgbase+'/new_goodxd_imgz2.png'" mode="aspectFit"
				v-if="dui == 0">
			</image>
			<image @click="godui(0)" class="w-105 h-105" :src=" Imgbase+'/new_goodxd_imgz1.png'" mode="aspectFit"
				v-else>
			</image>
		</view>

		<!-- 转换红豆 -->
		<u-popup :show="hongshow" @close="hongclose" mode="center" :round="10">
			<view class="w-650 radius-20 Afont">
				<view class="text-center font-32 padding-top-30" style="color: #606266;">
					提示
				</view>
				<view class="padding-30 " style="color: #606266;">
					是否转化为红豆，红豆不可用于盲盒抽奖，仅限商城购买，此操作不可逆
				</view>
				<view class="flex-between hbottom_btn margin-top-15">
					<view class="text-center h-80 lh-70 left" @click="hongclose">
						取消
					</view>
					<view class="text-center h-80 lh-70 right" @click="hongon">
						确定
					</view>
				</view>
			</view>
		</u-popup>

		<!-- 发货说明 -->
		<u-popup :show="show" @close="close" mode="center" :round="15" closeable>
			<view class="show_item w-650 h-900" style="background-color: #FBFADB;">
				<scroll-view scroll-y="true" show-scrollbar="true" style="height: 850rpx;">
					<view class="padding-30" style="color: #333;">
						<view class="text-center w100 font-weight-500 font-28 padding-bottom-15">
							{{desc.title}}
						</view>
						<u-parse :content="desc.content"></u-parse>
					</view>
				</scroll-view>
			</view>
		</u-popup>

		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		name: "myluck",
		data() {
			return {
				Imgbase: getApp().globalData.Imgbase,
				PageCur: 2,
				selekt: 0,
				fixed: 0,
				rareid: '',
				lockIndex: 0,
				page: 1,
				hasData: true,
				userpage: 1,
				backlist: {
					0: [],
					1: [],
					2: [],
					3: [],
					4: [],
					5: [],
					6: [],
					7: [],
					8: [],
					9: [],
					10: [],
					11: [],
					12: [],

				},
				count: 0,
				counts: 0,
				modalName: null,
				model: 1,
				show: false,
				desc: '',
				isdui: 1,
				userlist: [],
				yilist: [],
				refreshtime: 0,
				photoimg: '',
				looktitle: '',
				falist: ['正常发货', '随单发货'],
				curNow: 0,
				boxcount: 0,
				dui: 1,
				hongshow: false,
				hongindex: -1,
				skin: 'classics'
			};
		},
		onShareAppMessage(res) {
			let _this = this;
			return {
				title: '',
				path: '/pages/index/kpindex',
				imageUrl: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/1zhan_new_logo.png',
			}
		},
		onLoad(e) {},
		onShow() {
			if (uni.getStorageSync('skin')) {
				this.skin = uni.getStorageSync('skin')
			}

			uni.hideTabBar()
			this.userlist = []
			this.userpage = 1
			this.userBag();
			if (uni.getStorageSync('token') == '') {
				this.$uniApi.trylogin();
			}
		},
		onReachBottom() {
			let _this = this
			console.log(123123)
			if (_this.hasData) {
				if (_this.selekt == 0 && _this.dui == 1) {

				} else {
					_this.userpage++;
					_this.userBag();
				}

			}
		},
		methods: {
			hongon(e) {
				let _this = this

				if (this.hongindex == -1) {
					this.hongindex = e
				}

				if (_this.hongshow) {
					if (_this.dui == 0) {
						var arr = _this.userlist[_this.hongindex].id;
					} else {
						var arr = []
						arr.push({
							"goods_id": _this.userlist[_this.hongindex].goods_id,
							"num": _this.userlist[_this.hongindex].num
						})
					}
					this.goodsToAsset(JSON.stringify(arr))
				}

				this.hongshow = !this.hongshow
			},
			// s赏转换红豆
			async goodsToAsset(e) {
				let _this = this
				let item = await this.$api.post('usersys/goodsToAsset', {
					token: uni.getStorageSync('token'),
					dui: _this.dui,
					ids: e,
					// test: 1
				})
				console.log(item)

				if (item.code == '1') {
					this.$refs.uToast.show({
						message: item.msg,
					})
					this.userlist = []
					this.userpage = 1
					this.userBag();
				}
				this.hongindex = -1
			},
			hongclose() {
				this.hongshow = false
				this.hongindex = -1
			},
			sectionChange(index) {
				this.userlist = []
				this.userpage = 1
				this.curNow = index;
				this.userBag()
			},
			lookImages(url, title) {
				this.photoimg = url
				this.looktitle = title
				this.modalName = 'photomodel';
			},
			gocag() {
				uni.navigateTo({
					url: '/pages/goodspoor/casebag'
				})
			},
			startR() {
				if (getApp().globalData.couldFresh == true) {
					getApp().globalData.couldFresh = false;
					setTimeout(() => {
						getApp().globalData.couldFresh = true;
					}, 1000)
				} else {
					return;
				}
				this.refreshtime += 1;
				this.userlist = []
				this.userBag();
				this.$refs.uToast.show({
					message: "刷新成功",
					duration: 1200
				})
			},
			// 点击解锁按钮 --- 移出保险柜
			unlockbtn(e) {
				let _this = this;

				if (this.userlist[e].checked == 0) {
					this.userlist[e].checked = 1;
				} else {
					this.userlist[e].checked = 0
				}

				if (this.dui == 0) {
					var res = this.userlist[e].id;
				} else {
					var res = this.userlist[e].goods_id;
				}
				this.unlockBagMerge(res)

				// for (var i = 0; i < this.userlist.length; i++) {
				// 	if (this.userlist[i].checked == 1) {
				// 		if (res != '') {
				// 			res += ',';
				// 		}
				// 		if (this.isdui == 1) {
				// 			res += this.userlist[i].goods_id;
				// 		}
				// 	}
				// }
				// if (res == '') {
				// 	this.$refs.uToast.show({
				// 		message: "请选择要移入保险柜的赏品!",
				// 		duration: 1200
				// 	})
				// } else {
				// 	this.unlockBagMerge(res)
				// }
			},
			// 点击锁定按钮 --- 移入保险柜
			lockbtn(e) {
				let _this = this;
				if (this.userlist[e].checked == 0) {
					this.userlist[e].checked = 1;
				} else {
					this.userlist[e].checked = 0
				}

				// let res = '';
				if (this.dui == 0) {
					var res = this.userlist[e].id;
				} else {
					var res = this.userlist[e].goods_id;
				}
				this.lockBagMerge(res)
				// for (var i = 0; i < this.userlist.length; i++) {
				// 	if (this.userlist[i].checked == 1) {
				// 		if (res != '') {
				// 			res += ',';
				// 		}
				// 		if (this.isdui == 1) {
				// 			res += this.userlist[i].goods_id;
				// 		}
				// 	}
				// }
				// if (res == '') {
				// 	this.$refs.uToast.show({
				// 		message: "请选择要移入保险柜的赏品!",
				// 		duration: 1200
				// 	})
				// } else {
				// 	this.lockBagMerge(res)
				// }
				// console.log('iddui ', res)
			},
			// 移入保险柜
			async lockBagMerge(e) {
				let _this = this
				let item = await this.$api.post('usersys/lockBagMerge', {
					token: uni.getStorageSync('token'),
					ids: e,
					dui: _this.dui
				})
				if (item.code == 1) {
					this.userpage = 1
					this.userlist = []
					_this.userBag();
					this.$refs.uToast.show({
						message: "移入成功!",
						duration: 1200
					})
				}
			},
			// 移出保险柜
			async unlockBagMerge(e) {
				let _this = this
				let item = await this.$api.post('usersys/unlockBagMerge', {
					token: uni.getStorageSync('token'),
					ids: e,
					dui: _this.dui
				})
				if (item.code == 1) {
					this.userpage = 1
					this.userlist = []
					_this.userBag();
					this.$refs.uToast.show({
						message: "移出成功!",
						duration: 1200
					})
				}
			},
			tabsuo(e) {
				this.lockIndex = e
				this.page = 1
				this.userpage = 1
				this.userlist = []
				this.userBag();
			},
			// 进阶页面
			goadvanced() {
				this.$refs.uToast.show({
					message: "请前往APP使用此功能",
				})
				return
				uni.navigateTo({
					url: '/pagesA/advanced/index'
				})
			},
			// 查看图片
			viewImages(adimages) {
				let images = [];
				images = images.concat(adimages);
				uni.previewImage({
					urls: images,
					current: 0
				});
			},
			// 下单发货
			pushdeliver() {
				let _this = this;
				let res = '';
				var allchoosenum = 0;
				for (var i = 0; i < this.userlist.length; i++) {
					if (this.userlist[i].checked == 1) {
						if (this.userlist[i].state == 1) {
							uni.showToast({
								icon: 'none',
								title: '预售商品不可发货!'
							});
							return
						}
						if (res != '') {
							res += ',';
						}
						if (this.dui == 0) {
							res += this.userlist[i].id;
							allchoosenum += 1;
						}
						if (this.dui == 1) {
							res += this.userlist[i].goods_id;
							allchoosenum += this.userlist[i].num;
						}
					}
				}

				if (this.lockIndex == 1) {
					uni.showToast({
						icon: 'none',
						title: '请将物品移出保险柜'
					});
					return;
				}

				if (res == '') {
					uni.showToast({
						icon: 'none',
						title: '请选择要下单发货的赏品!'
					});
					return;
				}
				if (allchoosenum > 300) {
					uni.showModal({
						title: '提示',
						content: '您已经选择了' + allchoosenum + '件赏品,一次下单发货最大数量为300件,是否继续',
						success: function(result) {
							if (result.confirm) {
								uni.navigateTo({
									url: `/pages/goodspoor/pushdeliver?data=` + res + `&dui=` + _this
										.isdui + '&nums=' + allchoosenum
								});

							} else if (result.cancel) {}
						}
					});
					return;
				}
				uni.navigateTo({
					url: `/pages/goodspoor/pushdeliver?data=` + res + `&dui=` + _this.dui + '&nums=' +
						allchoosenum
				});
			},
			// 选择物品 --- 卡牌
			chooseGood(i, e) {
				if (this.backlist[i][e].checked == 0) {
					this.backlist[i][e].checked = 1
				} else {
					this.backlist[i][e].checked = 0
				}
				this.$forceUpdate()
			},
			// 选择物品 --- 赏品
			chooseGoods(e) {
				console.log(e)
				if (this.userlist[e].checked == 0) {
					this.userlist[e].checked = 1;
				} else {
					this.userlist[e].checked = 0
				}
				this.$forceUpdate()
			},
			// 富文本
			async explain(e) {
				this.model = 0
				let _this = this
				let item = await this.$api.post('Index/explain', {
					id: e
				})
				this.desc = item.data.desc
				this.show = true
			},
			close() {
				this.show = false
				this.model = 1
			},
			// 查看物流
			searchExpress(expressno, id) {
				let _this = this;
				// if(expressno == 0){
				// 	uni.navigateTo({
				// 		url: `/pages/goodspoor/express?expressno=${expressno}&uid=${id}`
				// 	})
				// }

				uni.navigateTo({
					url: `/pages/goodspoor/express?expressno=${expressno}&uid=${id}`
				})
			},
			onmodel() {
				this.modalName = 'showOrder'
				this.model = 0
			},
			hideModal(e) {
				this.modalName = null
				this.model = 1
			},
			seletab(i) {
				this.PageCur = i
				switch (i) {
					case 1:
						uni.switchTab({
							url: '/pages/goodspoor/index'
						})
						break;
					case 2:
						uni.switchTab({
							url: '/pages/goodspoor/backpack'
						})
						break;
					case 3:
						uni.switchTab({
							url: '/pages/index/kpindex'
						})
						break;
					case 4:
						uni.switchTab({
							url: '/pages/goodspoor/socity'
						})
						break;
					case 5:
						uni.switchTab({
							url: '/pages/goodspoor/user'
						})
						break;
				}
			},
			tabtwo(i) {
				this.userpage = 1
				this.selekt = i
				this.userlist = []
				this.userBag()
			},
			// 获取赏品背包列表
			async userBag() {
				let _this = this
				let item = await this.$api.post('Usersys/userBag', {
					page: _this.userpage,
					tab: _this.selekt,
					rare: _this.rareid,
					lock: _this.lockIndex,
					limit: 80,
					token: uni.getStorageSync('token'),
					dui: _this.dui,
					send_type: _this.curNow
				})
				this.counts = item.data.count
				this.boxcount = item.data.boxNum
				if (item.data.list.length > 0) {
					if (_this.selekt == 0 && _this.dui == 1) {
						_this.userlist = item.data.list
					} else {
						item.data.list.forEach(function(e, i) {
							item.data.list[i].checked = 0;
							_this.userlist = _this.userlist.concat(item.data.list[i])
						})
					}
					this.$forceUpdate()
					// console.log(_this.backlist)
				} else {
					this.$refs.uToast.show({
						message: "没有更多了",
						duration: 1000
					})
				}
				this.userlist.forEach(function(e, i) {
					e.checked = 0
				})
			},
			godui(i) {
				console.log(i)
				this.userpage = 1
				this.dui = i
				this.userlist = []
				this.userBag()
			},
			// fixed按钮
			fixed_btn() {
				if (this.fixed == 0) {
					this.fixed = 1
				} else {
					this.fixed = 0
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	button::after {
		border: none;
	}

	.hbottom_btn {
		border-top: 2rpx solid #EAEBEC;

		view {
			width: 50%;
		}

		.left {
			border-right: 2rpx solid #EAEBEC;
			color: #9f9f9f;
		}

		.right {
			color: #FBAD48;
		}


	}

	.baoxiang {

		.baotext {
			color: #F78D51;
			writing-mode: vertical-rl;
		}
	}
	
	.itemqing {
		background-color: rgba(27, 67, 27, .3);
		color: #1B431B;
	}

	.pos_dot {
		background-color: #fff;
		border: 4rpx solid #A15B25;
		position: absolute;
		left: 10rpx;
		top: 10rpx;
		z-index: 99;
		border-radius: 25rpx;

		.dotd {
			background-color: #4CB369;
			border-radius: 25rpx;
		}
	}


	/* 复选框 */
	.fuxuanks {
		border: 1px solid #000000;
		border-radius: 50%;
		height: 30rpx;
		width: 30rpx;
		position: absolute;
		left: 4%;
		size: 20rpx;
		top: 3%;
		text-align: center;
		line-height: 30rpx;

	}


	.fuxuankClicks {
		/* border: 1px solid #000000; */
		border-radius: 50%;
		height: 30rpx;
		width: 30rpx;
		position: absolute;
		left: 4%;
		size: 20rpx;
		top: 3%;
		text-align: center;
		line-height: 30rpx;
		background-color: #f69b46;
	}

	.xia_item {
		overflow: hidden;
		position: relative;
		float: left;
		margin-right: 30rpx;
		margin-bottom: 25rpx;

		.item_one {
			position: absolute;
			background-color: rgba(9, 9, 9, .4);
			color: #fff;
			bottom: 0;
			left: 0;
			width: 100%;
			padding: 15rpx 0;
			text-align: center;
			font-size: 22rpx;
		}
	}

	.xia_item:nth-child(3n) {
		margin-right: 0;
	}

	.shen-item {
		background-color: #FFFFF6;
		border: 4rpx solid #636363;
		font-size: 24rpx;
	}


	.fixeds {
		right: 20rpx;
		bottom: 350rpx;
	}

	.fixed_one {
		right: 20rpx;
		bottom: 510rpx;
	}

	.fixed_two {
		right: 130rpx;
		bottom: 420rpx;
	}

	.fixed_three {
		right: 130rpx;
		bottom: 280rpx;
	}

	.fixed_four {
		right: 20rpx;
		bottom: 210rpx;
	}

	.fixed_item {
		z-index: 999;
		position: fixed;
		transition: .3s;
		right: 20rpx;
		bottom: 450rpx;
	}

	.list_item {
		float: left;
		margin-right: 2%;
		margin-bottom: 20rpx;
		width: 32%;

		.hongbtn {
			position: absolute;
			bottom: 18rpx;
			left: 10rpx;
			z-index: 100;
		}
	}

	.list_item:nth-child(3n) {
		margin-right: 0;
	}



	.auto {
		margin: 0 auto;
	}

	button::after {
		border: initial;
	}

	.show_item {
		border: 6rpx solid #61AE5D;
		border-radius: 15rpx;
	}

	.fuxuankClick {
		background-color: #F6BE4B;
		border-radius: 10rpx;
	}

	.fuxuank {
		background-color: #353941;
		border-radius: 10rpx;
	}

	.animation {

		animation-name: shake; // 动画名称
		animation-direction: 10; // 动画在奇数次（1、3、5...）正向播放，在偶数次（2、4、6...）反向播放。
		animation-timing-function: linear; // 动画执行方式，linear：匀速；ease：先慢再快后慢；ease-in：由慢速开始；ease-out：由慢速结束；ease-in-out：由慢速开始和结束；
		animation-delay: 0s; // 动画延迟时间
		animation-iteration-count: infinite; //  动画播放次数，infinite：一直播放
		animation-duration: 4s; // 动画完成时间
		animation-fill-mode: backwards;
	}

	@keyframes shake {
		0% {
			transform: rotate(0deg);
		}

		5% {
			transform: rotate(10deg);
		}

		10% {
			transform: rotate(-15deg);
		}

		15% {
			transform: rotate(15deg);
		}

		20% {
			transform: rotate(-15deg);
		}

		25% {
			transform: rotate(15deg);
		}

		30% {
			transform: rotate(-15deg);
		}

		35% {
			transform: rotate(15deg);
		}

		40% {
			transform: rotate(-15deg);
		}

		45% {
			transform: rotate(15deg);
		}

		50% {
			transform: rotate(-15deg);
		}

		55% {
			transform: rotate(15deg);
		}

		60% {
			transform: rotate(-15deg);
		}

		65% {
			transform: rotate(15deg);
		}

		70% {
			transform: rotate(-15deg);
		}

		75% {
			transform: rotate(15deg);
		}

		80% {
			transform: rotate(-15deg);
		}

		85% {
			transform: rotate(15deg);
		}

		90% {
			transform: rotate(-15deg);
		}

		95% {
			transform: rotate(10deg);
		}

		100% {
			transform: rotate(0deg);
		}
	}
</style>